package cn.faster.common.utils.sys;

import sun.misc.BASE64Decoder;

import java.io.IOException;

/**
 * @author xiaoCoder
 * @version 1.0
 * @description: BASE64工具类
 * @date 2021/8/15 15:42
 */
public class BASE64DecoderUtils {

    /* *
     * @description: String 字符串解密
     * @author xiaoCoder
     * @date: 2021/8/15 15:43
     * @param: [text]
     * @return: java.lang.String
     */
    public static String decrypt(String text) throws IOException {
        return new String(getBASE64Decoder().decodeBuffer(text));
    }

    /* *
     * @description: 获取getBASE64Decoder构造器
     * @author xiaoCoder
     * @date: 2021/8/15 15:45
     * @param: []
     * @return: sun.misc.BASE64Decoder
     */
    public static BASE64Decoder getBASE64Decoder(){
        return new BASE64Decoder();
    }

}
